﻿<UserControl x:Class="SilverlightGraph.EntityControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="120" Height="30">
    <Canvas MouseEnter="Canvas_MouseEnter" MouseLeave="Canvas_MouseLeave" x:Name="mainCanvas">
        <Canvas.Resources>
            <Storyboard x:Name="highlightStoryboard">
                <ColorAnimation x:Name="highlightAnimation" 
              Storyboard.TargetName="endStop"
              Storyboard.TargetProperty="(Color)"
              To="Yellow" Duration="0:0:0.100" />
                <DoubleAnimation Storyboard.TargetName="rectangle"
                                  Storyboard.TargetProperty="StrokeThickness" To="2" Duration="0:0:0.100"/>
            </Storyboard>
            <Storyboard x:Name="highlightSecondaryStoryboard">
                <ColorAnimation x:Name="highlightSecondaryAnimation" 
              Storyboard.TargetName="endStop"
              Storyboard.TargetProperty="(Color)"
              To="#66ff33" Duration="0:0:0.100" />
                <DoubleAnimation Storyboard.TargetName="rectangle"
                                  Storyboard.TargetProperty="StrokeThickness" To="2" Duration="0:0:0.100"/>
            </Storyboard>
            <Storyboard x:Name="unHighlightStoryboard">
                <ColorAnimation x:Name="unHighlightAnimation" 
              Storyboard.TargetName="endStop"
              Storyboard.TargetProperty="(Color)"
              To="White" Duration="0:0:0.100" />
                <DoubleAnimation Storyboard.TargetName="rectangle"
                                  Storyboard.TargetProperty="StrokeThickness" To="1" Duration="0:0:0.100"/>
            </Storyboard>
        </Canvas.Resources>

        <Rectangle Stroke="Black" x:Name="rectangle" StrokeThickness="1" 
       Height="30" Width="100" RadiusX="10" RadiusY="5">
            <Rectangle.Fill>
                <RadialGradientBrush GradientOrigin="0.75,0.25">
                    <GradientStop Color="White" Offset="0.0" />
                    <GradientStop x:Name="endStop" Color="LightBlue" Offset="1.0" />
                </RadialGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <TextBlock TextAlignment="Center" TextWrapping="Wrap" Width="80" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="titleBlock">stop</TextBlock>
    </Canvas>

</UserControl>
